Use rb-kqueue on BSD systems

See: https://github.com/guard/listen#on-bsd

Akinori MUSHA 7 years ago
parent
commit
8a4b10c268
2 changed files with 6 additions and 0 deletions
  1. 3 0
      Gemfile
  2. 3 0
      Gemfile.lock

+ 3 - 0
Gemfile

@@ -166,10 +166,13 @@ group :production do
166 166
 end
167 167
 
168 168
 # Platform requirements.
169
+require 'rbconfig'
169 170
 gem 'ffi', '>= 1.9.4'		# required by typhoeus; 1.9.4 has fixes for *BSD.
170 171
 gem 'tzinfo', '>= 1.2.0'	# required by rails; 1.2.0 has support for *BSD and Solaris.
171 172
 # Windows does not have zoneinfo files, so bundle the tzinfo-data gem.
172 173
 gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
174
+# BSD systems require rb-kqueue for "listen" to avoid polling for changes.
175
+gem 'rb-kqueue', '>= 0.2', require: /bsd|dragonfly/i === RbConfig::CONFIG['target_os']
173 176
 
174 177
 
175 178
 on_heroku = ENV['ON_HEROKU'] ||

+ 3 - 0
Gemfile.lock

@@ -436,6 +436,8 @@ GEM
436 436
     rb-fsevent (0.9.7)
437 437
     rb-inotify (0.9.5)
438 438
       ffi (>= 0.5.0)
439
+    rb-kqueue (0.2.4)
440
+      ffi (>= 0.5.0)
439 441
     ref (2.0.0)
440 442
     responders (2.3.0)
441 443
       railties (>= 4.2.0, < 5.1)
@@ -666,6 +668,7 @@ DEPENDENCIES
666 668
   rack-livereload (~> 0.3.16)
667 669
   rails (~> 5.0.0.1)
668 670
   rails-controller-testing
671
+  rb-kqueue (>= 0.2)
669 672
   rr
670 673
   rspec (~> 3.5)
671 674
   rspec-collection_matchers (~> 1.1.0)